<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生交流</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/css/layui.css" tppabs="http://res.layui.com/layui/dist/css/layui.css"  media="all">
</head>
<body>
<!-- 表格 -->
<table class="layui-hide" id="ParentsStuCommunication" lay-filter="ParentsStuCommunication"></table>
</body>
<script src="/layui.js" charset="utf-8"></script>

<script>
    layui.use('table',function(){
        var table = layui.table;

        table.render({
            elem: '#ParentsStuCommunication'
            ,url:'/parents/communication'
            ,title: '学生交流'
            ,totalRow: true
            ,cols: [  [
                {type: 'checkbox', fixed: 'left', totalRowText: '合计行',align:'center'}
                ,{field:'id', title:'编号', width:120, fixed: 'left', unresize: true, sort: true,align:'center'}
                ,{field:'studentInfo' ,width:120, title: '学生姓名',align:'center', templet:function (res) {
                        return res.studentInfo.studentName;
                    }}
                ,{field:'communicateTime',width:120, title: '时间',align:'center', sort: true, align:'center'}
                ,{field:'communicateContent',width:300, title: '内容',align:'center'}
                ,{field:'teachers' ,width:120, title: '教师姓名',align:'center', templet:function (res) {
                        return res.teachers.teachersName;
                    }}
            ]  ]
            ,page: true
            ,response: {
                statusCode: 200 //重新规定成功的状态码为 200，table 组件默认为 0
            }
            ,parseData: function(res){ //将原始数据解析成 table 组件所规定的数据
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": res.data.count, //解析数据长度
                    "data": res.data.items //解析数据列表
                };
            }
        });
    });
</script>
</html>